package dataImport.action;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import dataImport.action.abstracts.AbstractInteractableEntityReader;
import dataImport.model.Npc;
import dataImport.model.abstracts.AbstractEntity;


public class NpcReader extends AbstractInteractableEntityReader {

	private static final long serialVersionUID = 4962420897229745745L;

	public static final String ENTITY_NAME = "npc";

	@Override
	protected AbstractEntity createEntity(final Element element) {
		final String id = element.getAttribute(ATTRIBUTE_ID);
		final String name = element.getAttribute(ATTRIBUTE_NAME);

		super.verifyRestrictions(id, name);

		return new Npc(id, name);
	}

	@Override
	public void read(final Document document) {
		this.read(NpcReader.ENTITY_NAME, document);
	}
}
